package com.adams.access.db.bean;

import java.util.HashMap;
import java.util.Map;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;

import net.sf.json.JSONObject;

/**
 * 
 * File Name : ViewPanelFilter.java
 * 
 * @Description : 界面面板自定义过滤条件
 */
@Entity
@Table(name = "T_VIEW_PANEL_FILTER")
public class ViewPanelFilter extends EntityObject
{

	/**
	 * Description : <Detail Description for package> Author : 904370
	 */
	private static final long serialVersionUID = -4511688914767102040L;

	/**
	 * Description : 名字 Author : 904370
	 */
	private String name;

	/**
	 * Description : 过滤 Author : 904370
	 */
	private String filter;

	/**
	 * Description : 提示信息 备注 Author : 904370
	 */
	private String tips;

	/**
	 * Description : 界面Panelid Author : 904370
	 */
	private Long viewpanelid;

	@Column(name = "NAME")
	public String getName()
	{
		return name;
	}

	public void setName(String name)
	{
		this.name = name;
	}

	@Column(name = "FILTER")
	public String getFilter()
	{
		return filter;
	}

	public void setFilter(String filter)
	{
		this.filter = filter;
	}

	@Column(name = "TIPS")
	public String getTips()
	{
		return tips;
	}

	public void setTips(String tips)
	{
		this.tips = tips;
	}

	@Column(name = "VIEWPANELID")
	public Long getViewpanelid()
	{
		return viewpanelid;
	}

	public void setViewpanelid(Long viewpanelid)
	{
		this.viewpanelid = viewpanelid;
	}

	/**
	 * Description : 得到过滤条件map
	 * 
	 * @return
	 * 
	 */
	@SuppressWarnings("unchecked")
	@Transient
	public Map getFilterMaps()
	{
		Map result = new HashMap();
		if (null != filter && filter.length() > 0)
		{
			JSONObject data = JSONObject.fromObject(filter);
			result = (Map) JSONObject.toBean(data, HashMap.class);
		}
		return result;
	}
}
